//169
int majorityElement(int* nums, int numsSize)
{
    int tmp=nums[0];
    int count=1;
    for(int i=1;i<numsSize;i++)
    {
        if(nums[i]==tmp)
        {
            count++;
        }
        else
        {
            count--;
        }
        if(count==0)
        tmp=nums[i+1];

    }
	return tmp;

}